package sharemem

type Buff struct {
	Id			int32
	Type		int8
	Sub_type	int8
	Group		int32
	Grade		int8
	Tag			int8
	Ctype		bool
	Condition	[BATTLE_PARAM_MAX1][BATTLE_PARAM_MAX2]int32
	Loop_time	int32
	End_time	int32
	Level_max	int8
	Level_func	int8
	Param1		[BATTLE_PARAM_MAX2]int32
}

func (tmp *Buff) meminit() {
	var i,j int32
	tmp.Id = 0
	tmp.Type = 0
	tmp.Sub_type = 0
	tmp.Group = 0
	tmp.Grade = 0
	tmp.Tag = 0
	tmp.Ctype = true
	for i = 0; i < BATTLE_PARAM_MAX1; i++ {
		for j=0;j<BATTLE_PARAM_MAX2;j++ {
			tmp.Condition[i][j] = 0
		}
	}
	tmp.Loop_time = 0
	tmp.End_time = 0
	tmp.Level_max = 0
	tmp.Level_func = 0
	for i = 0; i < BATTLE_PARAM_MAX2; i++ {
		tmp.Param1[i] = 0
	}
}
func (tmp *Buff) isUse() bool {
	return tmp.Id > 0
}
func (tmp *Buff) getId() int32 {
	return tmp.Id
}

func Get_config_buff(id int32) *Buff {
	v, ok := GetConfigBuffMap()[id]
	if !ok {
		return nil
	}

	return v
}
